package com.niiwoo.civet.trade.dto.response.myloan.inner;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by bincun on 2017/11/23.
 */
@Getter
@Setter
public  class BackToArticleDetails implements Serializable {

    private static final long serialVersionUID = -7636687497068780474L;

    /**
     * 应收款日期
     */
    private Date receivedDate;

    public String getDateNumStr() {
        return receivedDate.getDate()+"";
    }

    private String dateNumStr;

    private String mouthNumStr;
    
    public String getMouthNumStr() {
        if(receivedDate != null){
        	SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
            String  date = sdf.format(receivedDate);
            return date.substring(0,date.length()-2);
        }else {
            return "";
        }
    }
    
    /**
     * 当日应回款总本金
     */
    private BigDecimal totalCapital;
    
    /**
     * 当然应回款总利息
     */
    private BigDecimal totalInterest;

    // 标的ID
    private Long projectId;

    //当日总奖励
    private BigDecimal totalReward = BigDecimal.ZERO;

    //预计回款金额
    private BigDecimal expectReceivableAmount;

    public BigDecimal getExpectReceivableAmount() {
        return totalCapital.add(totalInterest.add(totalReward));
    }

    //当日回款笔数
    private Integer receivableNumber;

}